/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaces;

import Factory.AUPizzaFactory;
import Factory.CNPizzaFactory;
import Factory.MLPizzaFactory;
import Factory.PizzaFactory;
import data.Configuration;
import Decorator.*;
import VendingMachine.AUVendingMachine;
import VendingMachine.CNVendingMachine;
import VendingMachine.MLVendingMachine;
import VendingMachine.VendingMachine;
import admin.*;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.io.FileNotFoundException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import payment.*;
import sun.text.normalizer.IntTrie;

/**
 *
 * @author shenrunfu
 */
public class main extends javax.swing.JFrame {

    PizzaFactory factory;
    Payment payment;
    ArrayList<JButton> moneyList;
    ArrayList<Money> moneyTypeList;
    double moneyReceive;
    VendingMachine vm;
    WareHouse wareHouse;
  
    /**
     * Creates new form main
     */
    public main() {
        initComponents();
        jbt_money1.setVisible(false);
        jbt_money2.setVisible(false);
        jbt_money3.setVisible(false);
        jbt_money4.setVisible(false);
        jbt_money5.setVisible(false);
        jbt_money6.setVisible(false);
        jbt_money7.setVisible(false);
        jbt_money8.setVisible(false);
        jbt_money9.setVisible(false);

        //setting money notes and coins
        moneyList = new ArrayList<JButton>();
        moneyList.add(jbt_money1);
        moneyList.add(jbt_money2);
        moneyList.add(jbt_money3);
        moneyList.add(jbt_money4);
        moneyList.add(jbt_money5);
        moneyList.add(jbt_money6);
        moneyList.add(jbt_money8);
        moneyList.add(jbt_money9);

        //hide setting. 
        jpl_setting.setVisible(false);
        MoneyReceive gotMoney = new MoneyReceive();
        for (JButton jb : moneyList) {
            jb.addActionListener(gotMoney);
        }

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFrame1 = new javax.swing.JFrame();
        jFrame2 = new javax.swing.JFrame();
        jFrame3 = new javax.swing.JFrame();
        jpnl_country = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jbtn_next_1 = new javax.swing.JButton();
        jcb_country = new javax.swing.JComboBox();
        jpnl_Pizza = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jcb_base = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jlabel_price = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jlabel_discount = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jlabel_gst = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        jlabel_total = new javax.swing.JLabel();
        jcb_cheese = new javax.swing.JCheckBox();
        jcb_seafood = new javax.swing.JCheckBox();
        jcb_mushroom = new javax.swing.JCheckBox();
        jcb_beef = new javax.swing.JCheckBox();
        jcb_redonion = new javax.swing.JCheckBox();
        jbtn_caculate = new javax.swing.JButton();
        canvas1 = new java.awt.Canvas();
        jLabel28 = new javax.swing.JLabel();
        jlb_num_base = new javax.swing.JLabel();
        jlb_num_cheese = new javax.swing.JLabel();
        jlb_num_beef = new javax.swing.JLabel();
        jlb_num_mushroom = new javax.swing.JLabel();
        jlb_num_redonion = new javax.swing.JLabel();
        jlb_num_seafood = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jlbl_moneyReceive = new javax.swing.JLabel();
        jButton10 = new javax.swing.JButton();
        jpl_money = new javax.swing.JPanel();
        jbt_money1 = new javax.swing.JButton();
        jbt_money2 = new javax.swing.JButton();
        jbt_money3 = new javax.swing.JButton();
        jbt_money4 = new javax.swing.JButton();
        jbt_money5 = new javax.swing.JButton();
        jbt_money6 = new javax.swing.JButton();
        jbt_money7 = new javax.swing.JButton();
        jbt_money8 = new javax.swing.JButton();
        jbt_money9 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jlb_change = new javax.swing.JLabel();
        jButton13 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jbl_change = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jlb_machine_state = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtf_admin = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jpf_pwd = new javax.swing.JPasswordField();
        jButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jpl_setting = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jtf_classic = new javax.swing.JTextField();
        jtf_crispy = new javax.swing.JTextField();
        jtn_save = new javax.swing.JButton();
        jtf_cheese_base = new javax.swing.JTextField();
        jtf_veggie = new javax.swing.JTextField();
        jtf_pepperoni = new javax.swing.JTextField();
        jtf_cheese = new javax.swing.JTextField();
        jtf_seafood = new javax.swing.JTextField();
        jtf_mushroom = new javax.swing.JTextField();
        jtf_beef = new javax.swing.JTextField();
        jtf_redonion = new javax.swing.JTextField();

        org.jdesktop.layout.GroupLayout jFrame1Layout = new org.jdesktop.layout.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

        org.jdesktop.layout.GroupLayout jFrame2Layout = new org.jdesktop.layout.GroupLayout(jFrame2.getContentPane());
        jFrame2.getContentPane().setLayout(jFrame2Layout);
        jFrame2Layout.setHorizontalGroup(
            jFrame2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
        );
        jFrame2Layout.setVerticalGroup(
            jFrame2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

        org.jdesktop.layout.GroupLayout jFrame3Layout = new org.jdesktop.layout.GroupLayout(jFrame3.getContentPane());
        jFrame3.getContentPane().setLayout(jFrame3Layout);
        jFrame3Layout.setHorizontalGroup(
            jFrame3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
        );
        jFrame3Layout.setVerticalGroup(
            jFrame3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jpnl_country.setBackground(new java.awt.Color(0, 102, 153));
        jpnl_country.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel3.setText("Choose your country");

        jbtn_next_1.setText("Next");
        jbtn_next_1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_next_1ActionPerformed(evt);
            }
        });

        jcb_country.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Australia", "China", "Malyasia" }));

        org.jdesktop.layout.GroupLayout jpnl_countryLayout = new org.jdesktop.layout.GroupLayout(jpnl_country);
        jpnl_country.setLayout(jpnl_countryLayout);
        jpnl_countryLayout.setHorizontalGroup(
            jpnl_countryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpnl_countryLayout.createSequentialGroup()
                .add(jpnl_countryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jpnl_countryLayout.createSequentialGroup()
                        .add(20, 20, 20)
                        .add(jcb_country, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 23, Short.MAX_VALUE)
                        .add(jbtn_next_1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jpnl_countryLayout.createSequentialGroup()
                        .add(29, 29, 29)
                        .add(jLabel3)
                        .add(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jpnl_countryLayout.setVerticalGroup(
            jpnl_countryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpnl_countryLayout.createSequentialGroup()
                .add(9, 9, 9)
                .add(jLabel3)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jpnl_countryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_country, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jbtn_next_1))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jpnl_Pizza.setBackground(new java.awt.Color(0, 153, 153));
        jpnl_Pizza.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel1.setText("Select Pizza Base: ");

        jcb_base.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Classic", "Crispy", "Cheese", "Veggie", "Pepperoni", " ", " " }));
        jcb_base.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcb_baseActionPerformed(evt);
            }
        });

        jLabel2.setText("Select Topping: ");

        jLabel4.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel4.setText("Choose your Pizzas");

        jLabel5.setText("Price");

        jlabel_price.setText("0");

        jLabel7.setText("Discount:");

        jlabel_discount.setText("0");

        jLabel9.setText("GST:");

        jlabel_gst.setText("0");

        jButton3.setText("Next");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel11.setText("Total:");

        jlabel_total.setText("0");

        jcb_cheese.setText("Cheese");
        jcb_cheese.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcb_cheeseActionPerformed(evt);
            }
        });

        jcb_seafood.setText("Seafood");

        jcb_mushroom.setText("Mushroom");

        jcb_beef.setText("Beef");

        jcb_redonion.setText("RedOnion");
        jcb_redonion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcb_redonionActionPerformed(evt);
            }
        });

        jbtn_caculate.setText("caculate");
        jbtn_caculate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_caculateActionPerformed(evt);
            }
        });

        jlb_num_base.setText("0");

        jlb_num_cheese.setText("0");

        jlb_num_beef.setText("0");

        jlb_num_mushroom.setText("0");

        jlb_num_redonion.setText("0");

        jlb_num_seafood.setText("0");

        org.jdesktop.layout.GroupLayout jpnl_PizzaLayout = new org.jdesktop.layout.GroupLayout(jpnl_Pizza);
        jpnl_Pizza.setLayout(jpnl_PizzaLayout);
        jpnl_PizzaLayout.setHorizontalGroup(
            jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jpnl_PizzaLayout.createSequentialGroup()
                .add(0, 0, Short.MAX_VALUE)
                .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(41, 41, 41))
            .add(jpnl_PizzaLayout.createSequentialGroup()
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .add(89, 89, 89)
                        .add(jLabel4))
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .add(32, 32, 32)
                        .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jpnl_PizzaLayout.createSequentialGroup()
                                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jLabel9)
                                    .add(jLabel11)
                                    .add(jLabel7))
                                .add(9, 9, 9))
                            .add(jpnl_PizzaLayout.createSequentialGroup()
                                .add(jLabel5)
                                .add(12, 12, 12)))
                        .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jlabel_gst)
                            .add(jlabel_discount)
                            .add(jlabel_price)
                            .add(jlabel_total)))
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jcb_mushroom))
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jcb_redonion))
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .add(15, 15, 15)
                        .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel2)
                            .add(jLabel1)))
                    .add(jpnl_PizzaLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jpnl_PizzaLayout.createSequentialGroup()
                                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jcb_seafood)
                                    .add(jcb_beef)
                                    .add(jcb_base, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 132, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                        .add(jbtn_caculate)
                                        .add(jpnl_PizzaLayout.createSequentialGroup()
                                            .add(2, 2, 2)
                                            .add(jLabel28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                        .add(jlb_num_redonion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(jlb_num_mushroom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jlb_num_base, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jlb_num_beef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jlb_num_seafood, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(jpnl_PizzaLayout.createSequentialGroup()
                                .add(jcb_cheese)
                                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jpnl_PizzaLayout.createSequentialGroup()
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jpnl_PizzaLayout.createSequentialGroup()
                                        .add(78, 78, 78)
                                        .add(jlb_num_cheese, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))))
                .addContainerGap(72, Short.MAX_VALUE))
        );
        jpnl_PizzaLayout.setVerticalGroup(
            jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpnl_PizzaLayout.createSequentialGroup()
                .add(18, 18, 18)
                .add(jLabel4)
                .add(18, 18, 18)
                .add(jLabel1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_base, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel28)
                    .add(jlb_num_base))
                .add(26, 26, 26)
                .add(jLabel2)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_cheese)
                    .add(jlb_num_cheese))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_beef)
                    .add(jlb_num_beef))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_mushroom)
                    .add(jlb_num_mushroom))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_redonion)
                    .add(jlb_num_redonion))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jcb_seafood)
                    .add(jlb_num_seafood))
                .add(17, 17, 17)
                .add(jbtn_caculate)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 62, Short.MAX_VALUE)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel5)
                    .add(jlabel_price))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(jlabel_discount))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel9)
                    .add(jlabel_gst))
                .add(18, 18, 18)
                .add(jpnl_PizzaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel11)
                    .add(jlabel_total))
                .add(18, 18, 18)
                .add(jButton3)
                .add(30, 30, 30))
        );

        jPanel1.setBackground(new java.awt.Color(0, 153, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel13.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel13.setText("Pay for your Pizzas");

        jLabel14.setText("Payment:");

        jlbl_moneyReceive.setText("0");

        jButton10.setText("Next");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jbt_money1.setText("$20");
        jbt_money1.setDoubleBuffered(true);
        jbt_money1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money1ActionPerformed(evt);
            }
        });

        jbt_money2.setText("$10");
        jbt_money2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money2ActionPerformed(evt);
            }
        });

        jbt_money3.setText("$5");
        jbt_money3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money3ActionPerformed(evt);
            }
        });

        jbt_money4.setText("$1");
        jbt_money4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money4ActionPerformed(evt);
            }
        });

        jbt_money5.setText("$0.5");
        jbt_money5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money5ActionPerformed(evt);
            }
        });

        jbt_money6.setText("$0.1");
        jbt_money6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money6ActionPerformed(evt);
            }
        });

        jbt_money7.setText("$0.1");
        jbt_money7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money7ActionPerformed(evt);
            }
        });

        jbt_money8.setText("$0.1");
        jbt_money8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money8ActionPerformed(evt);
            }
        });

        jbt_money9.setText("$0.1");
        jbt_money9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_money9ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jpl_moneyLayout = new org.jdesktop.layout.GroupLayout(jpl_money);
        jpl_money.setLayout(jpl_moneyLayout);
        jpl_moneyLayout.setHorizontalGroup(
            jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpl_moneyLayout.createSequentialGroup()
                .addContainerGap()
                .add(jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jpl_moneyLayout.createSequentialGroup()
                        .add(0, 0, Short.MAX_VALUE)
                        .add(jbt_money1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jbt_money2)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jbt_money3))
                    .add(jpl_moneyLayout.createSequentialGroup()
                        .add(jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jpl_moneyLayout.createSequentialGroup()
                                .add(jbt_money7)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jbt_money8)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jbt_money9))
                            .add(jpl_moneyLayout.createSequentialGroup()
                                .add(jbt_money4)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jbt_money5)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jbt_money6)))
                        .add(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jpl_moneyLayout.setVerticalGroup(
            jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpl_moneyLayout.createSequentialGroup()
                .add(0, 13, Short.MAX_VALUE)
                .add(jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jbt_money1)
                    .add(jbt_money2)
                    .add(jbt_money3))
                .add(18, 18, 18)
                .add(jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jbt_money4)
                    .add(jbt_money5)
                    .add(jbt_money6))
                .add(18, 18, 18)
                .add(jpl_moneyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jbt_money7)
                    .add(jbt_money8)
                    .add(jbt_money9))
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(70, 70, 70)
                        .add(jLabel13))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(44, 44, 44)
                        .add(jLabel14)
                        .add(18, 18, 18)
                        .add(jlbl_moneyReceive, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 59, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(193, 193, 193)
                        .add(jButton10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(25, 25, 25)
                        .add(jpl_money, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(18, 18, 18)
                .add(jLabel13)
                .add(28, 28, 28)
                .add(jpl_money, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(18, 339, Short.MAX_VALUE)
                        .add(jButton10)
                        .add(27, 27, 27))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(27, 27, 27)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel14)
                            .add(jlbl_moneyReceive))
                        .addContainerGap())))
        );

        jPanel2.setBackground(new java.awt.Color(204, 204, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel16.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel16.setText("Take your changes");

        jLabel21.setText("Change:");

        jlb_change.setText("0");

        jButton13.setText("Finish");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jbl_change.setText("null");

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(42, 42, 42)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(jLabel21)
                        .add(18, 18, 18)
                        .add(jlb_change))
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jPanel2Layout.createSequentialGroup()
                                .add(0, 0, Short.MAX_VALUE)
                                .add(jButton13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jPanel2Layout.createSequentialGroup()
                                .add(jLabel6)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 31, Short.MAX_VALUE)
                                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel16)
                                    .add(jbl_change))))
                        .addContainerGap(36, Short.MAX_VALUE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(15, 15, 15)
                .add(jLabel16)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jbl_change)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel6)
                .add(122, 122, 122)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel21)
                    .add(jlb_change))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jButton13)
                .add(18, 18, 18))
        );

        jLabel8.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel8.setText("Machine State:");

        jlb_machine_state.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jlb_machine_state.setText("null");

        jPanel3.setBackground(new java.awt.Color(204, 204, 255));

        jLabel10.setText("Admin Login");

        jLabel12.setText("Admin:");

        jtf_admin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_adminActionPerformed(evt);
            }
        });

        jLabel15.setText("Password:");

        jButton1.setText("Login");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
                .add(16, 16, 16)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jPanel4Layout.createSequentialGroup()
                        .add(jLabel12)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jtf_admin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                        .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(jPanel4Layout.createSequentialGroup()
                            .add(jLabel15)
                            .add(18, 18, 18)
                            .add(jpf_pwd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jPanel4Layout.createSequentialGroup()
                            .add(jLabel10)
                            .add(43, 43, 43))))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel12)
                    .add(jtf_admin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel15)
                    .add(jpf_pwd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jButton1))
        );

        jLabel17.setText("Classic");

        jLabel18.setText("Crispy");

        jLabel19.setText("Cheese");

        jLabel20.setText("Veggie");

        jLabel22.setText("Pepperoni");

        jLabel23.setText("Cheese");

        jLabel24.setText("Seafood");

        jLabel25.setText("Mushroom");

        jLabel26.setText("Beef");

        jLabel27.setText("RedOnion");

        jtn_save.setText("Save");
        jtn_save.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtn_saveActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jpl_settingLayout = new org.jdesktop.layout.GroupLayout(jpl_setting);
        jpl_setting.setLayout(jpl_settingLayout);
        jpl_settingLayout.setHorizontalGroup(
            jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpl_settingLayout.createSequentialGroup()
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jpl_settingLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(jpl_settingLayout.createSequentialGroup()
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel17)
                                    .add(jLabel18)
                                    .add(jLabel19)
                                    .add(jLabel20))
                                .add(40, 40, 40)
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                    .add(jtf_veggie, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                                    .add(jtf_cheese_base)
                                    .add(jtf_crispy)
                                    .add(jtf_classic)))
                            .add(jpl_settingLayout.createSequentialGroup()
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel22)
                                    .add(jLabel23)
                                    .add(jLabel24))
                                .add(23, 23, 23)
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jtf_seafood)
                                    .add(jtf_pepperoni)
                                    .add(jtf_cheese)))
                            .add(jpl_settingLayout.createSequentialGroup()
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel25)
                                    .add(jLabel26)
                                    .add(jLabel27))
                                .add(18, 18, 18)
                                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jtf_redonion)
                                    .add(jtf_beef)
                                    .add(jtf_mushroom, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)))))
                    .add(jpl_settingLayout.createSequentialGroup()
                        .add(122, 122, 122)
                        .add(jtn_save)))
                .addContainerGap(153, Short.MAX_VALUE))
        );
        jpl_settingLayout.setVerticalGroup(
            jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jpl_settingLayout.createSequentialGroup()
                .add(6, 6, 6)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel17)
                    .add(jtf_classic, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel18)
                    .add(jtf_crispy, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel19)
                    .add(jtf_cheese_base, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel20)
                    .add(jtf_veggie, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel22)
                    .add(jtf_pepperoni, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel23)
                    .add(jtf_cheese, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel24)
                    .add(jtf_seafood, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel25)
                    .add(jtf_mushroom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel26)
                    .add(jtf_beef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jpl_settingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel27)
                    .add(jtf_redonion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jtn_save)
                .addContainerGap(112, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(jpl_setting);

        org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 400, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(jpnl_country, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jpnl_Pizza, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(layout.createSequentialGroup()
                        .add(275, 275, 275)
                        .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jlb_machine_state, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(403, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jlb_machine_state, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup()
                                .add(jpnl_country, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jpnl_Pizza, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .add(0, 0, Short.MAX_VALUE))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    class MoneyReceive implements ActionListener {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            String valueString = ((JButton) evt.getSource()).getText();
            String[] strArr = valueString.split(" ");
            Double valueDouble = Double.parseDouble(strArr[1]);
            moneyReceive += valueDouble;
            jlbl_moneyReceive.setText(Double.toString(moneyReceive));
//            MoneyFlyWeightFacgory tMoneyFlyWeightFacgory = new MoneyFlyWeightFacgory();
//            Money tMoney = tMoneyFlyWeightFacgory.getMoneyByCountryAmount(Configuration.getCountry(), Double.parseDouble(strArr[1]));
//            tMoney.increaseCount();


        }
    }

    private void jbt_money1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money1ActionPerformed

    private void jbt_money2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money2ActionPerformed

    private void jbt_money3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money3ActionPerformed

    private void jbt_money5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money5ActionPerformed

    private void jbt_money4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money4ActionPerformed

    private void jbt_money6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money6ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money6ActionPerformed

    /**
     * first step
     *
     * @param
     */
    private void jbtn_next_1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_next_1ActionPerformed
        // setting global variables
        String country = jcb_country.getSelectedItem().toString();
        payment=null;
//        moneyList=null;
        moneyReceive=0;
//        jlbl_moneyReceive=null;
        jbl_change.setText("");
        jlb_change.setText("");

        jlbl_moneyReceive.setText("");
        
        jbt_money1.setVisible(false);
        //
        if (country == "Australia") {
            Configuration.setCountry("AU");
            factory = new AUPizzaFactory();
            MoneyFlyWeightFacgory moneyFactory = new MoneyFlyWeightFacgory();
            moneyTypeList = moneyFactory.getMoneyByCountry("AU");
            resetMoneyButtons();
            if (wareHouse == null || !(wareHouse instanceof AUWareHouse)) {
                wareHouse = factory.createWareHouse();
            }
            

            for (int i = 0; i < moneyTypeList.size(); i++) {
                moneyList.get(i).setText("A$ " + Double.toString(moneyTypeList.get(i).getValue()));
                moneyList.get(i).setVisible(true);
            }
            
            vm = AUVendingMachine.getInstance();
            try {
//                jpnl_country.setBackground(vm.getColor("AU"));
                jpnl_Pizza.setBackground(vm.getColor("AU"));
                jPanel1.setBackground(vm.getColor("AU"));
                jPanel2.setBackground(vm.getColor("AU"));
            } catch (FileNotFoundException ex) {
               showMsg("File not Found!!");
            }

        }
        if (country == "China" ) {
            Configuration.setCountry("CN");
            factory = new CNPizzaFactory();
            MoneyFlyWeightFacgory moneyFactory = new MoneyFlyWeightFacgory();
            moneyTypeList = moneyFactory.getMoneyByCountry("CN");
            resetMoneyButtons();
            if (wareHouse == null || !(wareHouse instanceof CNWareHouse)) {
                wareHouse = factory.createWareHouse();
            }
            for (int i = 0; i < moneyTypeList.size(); i++) {
                moneyList.get(i).setText("￥ " + Double.toString(moneyTypeList.get(i).getValue()));
                moneyList.get(i).setVisible(true);
            }
            vm = CNVendingMachine.getInstance();
            try {
//                jpnl_country.setBackground(vm.getColor("CN"));
                jpnl_Pizza.setBackground(vm.getColor("CN"));
                jPanel1.setBackground(vm.getColor("CN"));
                jPanel2.setBackground(vm.getColor("CN"));
            } catch (FileNotFoundException ex) {
               showMsg("File not Found!!");
            }
        }
        if (country == "Malyasia") {
            Configuration.setCountry("ML");
            factory = new MLPizzaFactory();
            MoneyFlyWeightFacgory moneyFactory = new MoneyFlyWeightFacgory();
            moneyTypeList = moneyFactory.getMoneyByCountry("ML");
            resetMoneyButtons();
            if (wareHouse == null || !(wareHouse instanceof MLWareHouse)) {
                wareHouse = factory.createWareHouse();
            }
            for (int i = 0; i < moneyTypeList.size(); i++) {
                moneyList.get(i).setText("M$ " + Double.toString(moneyTypeList.get(i).getValue()));
                moneyList.get(i).setVisible(true);
            }
            vm = MLVendingMachine.getInstance();
            try {
//                jpnl_country.setBackground(vm.getColor("ML"));
                jpnl_Pizza.setBackground(vm.getColor("ML"));
                jPanel1.setBackground(vm.getColor("ML"));
                jPanel2.setBackground(vm.getColor("ML"));
            } catch (FileNotFoundException ex) {
               showMsg("File not Found!!");
            }
        }

        //setting base number
        if (jcb_base.getSelectedItem().toString().equals("Classic")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getClassicBaseNum()));
        }

        //setting topping number
        jlb_num_cheese.setText(Integer.toString(wareHouse.getCheeseNum()));
        jlb_num_beef.setText(Integer.toString(wareHouse.getBeefNum()));
        jlb_num_mushroom.setText(Integer.toString(wareHouse.getMushroomNum()));
        jlb_num_redonion.setText(Integer.toString(wareHouse.getRedOnionNum()));
        jlb_num_seafood.setText(Integer.toString(wareHouse.getSeafoodNum()));

//        vm = AUVendingMachine.getInstance();
        jlb_machine_state.setText(vm.DisplayState());
//        showMsg(vm.DisplayState());

    }//GEN-LAST:event_jbtn_next_1ActionPerformed

    private void resetMoneyButtons() {
        for (int i = 0; i < moneyList.size(); i++) {
            moneyList.get(i).setVisible(false);
        }
    }

    //selecting pizza base
    private void jcb_baseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcb_baseActionPerformed
        String base_name = ((JComboBox) evt.getSource()).getSelectedItem().toString();

        if (base_name.equals("Classic")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getClassicBaseNum()));
        }
        if (base_name.equals("Cheese")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getCheeseBaseNum()));
        }
        if (base_name.equals("Crispy")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getCrispyBaseNum()));
        }
        if (base_name.equals("Pepperoni")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getPepperoniBaseNum()));
        }
        if (base_name.equals("Veggie")) {
            jlb_num_base.setText(Integer.toString(wareHouse.getViggieBaseNum()));
        }
    }//GEN-LAST:event_jcb_baseActionPerformed

    //caculate out total price.
    private void jbtn_caculateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_caculateActionPerformed
        String pizzaBaseString = jcb_base.getSelectedItem().toString();
        PizzaBase pizza = factory.createBase(pizzaBaseString);

        if (jcb_cheese.isSelected()) {
            pizza = factory.createTopping(jcb_cheese.getText(), pizza);
        }
        if (jcb_beef.isSelected()) {
            pizza = factory.createTopping(jcb_beef.getText(), pizza);
        }
        if (jcb_mushroom.isSelected()) {
            pizza = factory.createTopping(jcb_mushroom.getText(), pizza);
        }
        if (jcb_redonion.isSelected()) {
            pizza = factory.createTopping(jcb_redonion.getText(), pizza);
        }
        if (jcb_seafood.isSelected()) {
            pizza = factory.createTopping(jcb_seafood.getText(), pizza);
        }

        payment = new Payment();
        PizzaDiscountInfo discountInfo = new PizzaDiscountInfo();
        GSTStrategy gst = factory.createGSTStrategy();

        payment.setDiscount(discountInfo);
        payment.setGSTStrategy(gst);
        payment.setPizzaBase(pizza);

        //updating recipt
        jlabel_price.setText(format(payment.getPizzaBase().getTotalPrice()));
        jlabel_discount.setText(format(payment.getDiscountInfo().getRate() * payment.getPizzaBase().getTotalPrice()));
        jlabel_gst.setText(format(payment.getGstStrategy().calculateGST(payment.getPizzaBase().getTotalPrice() - payment.getPizzaBase().getTotalPrice() * payment.getDiscountInfo().getRate())));
        jlabel_total.setText(format(payment.calculatePayment()));



    }//GEN-LAST:event_jbtn_caculateActionPerformed

    String format(double d) {
        NumberFormat formatter = new DecimalFormat("0.00");
        return formatter.format(d);
    }
    private void jcb_redonionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcb_redonionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcb_redonionActionPerformed

    private void jbt_money7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money7ActionPerformed

    private void jbt_money8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money8ActionPerformed

    private void jbt_money9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_money9ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbt_money9ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        String base_name = jcb_base.getSelectedItem().toString();

        if (base_name.equals("Classic")) {
            if (wareHouse.getClassicBaseNum() != 0) {
                wareHouse.setClassicBaseNum(wareHouse.getClassicBaseNum() - 1);
                jlb_num_base.setText(Integer.toString(wareHouse.getClassicBaseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (base_name.equals("Cheese")) {
            if (wareHouse.getCheeseBaseNum() != 0) {
                wareHouse.setCheeseBaseNum(wareHouse.getCheeseBaseNum() - 1);
                jlb_num_base.setText(Integer.toString(wareHouse.getCheeseBaseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (base_name.equals("Crispy")) {
            if (wareHouse.getCrispyBaseNum() != 0) {
                wareHouse.setCrispyBaseNum(wareHouse.getCrispyBaseNum() - 1);
                jlb_num_base.setText(Integer.toString(wareHouse.getCrispyBaseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (base_name.equals("Pepperoni")) {
            if (wareHouse.getPepperoniBaseNum() != 0) {
                wareHouse.setPepperoniBaseNum(wareHouse.getPepperoniBaseNum() - 1);
                jlb_num_base.setText(Integer.toString(wareHouse.getPepperoniBaseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (base_name.equals("Veggie")) {
            if (wareHouse.getViggieBaseNum() != 0) {
                wareHouse.setViggieBaseNum(wareHouse.getViggieBaseNum() - 1);
                jlb_num_base.setText(Integer.toString(wareHouse.getViggieBaseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }


        if (jcb_cheese.isSelected()) {
            if (wareHouse.getCheeseNum() != 0) {
                wareHouse.setCheeseNum(wareHouse.getCheeseNum() - 1);
                jlb_num_cheese.setText(Integer.toString(wareHouse.getCheeseNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (jcb_beef.isSelected()) {
            if (wareHouse.getBeefNum() != 0) {
                wareHouse.setBeefNum(wareHouse.getBeefNum() - 1);
                jlb_num_beef.setText(Integer.toString(wareHouse.getBeefNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (jcb_mushroom.isSelected()) {
            if (wareHouse.getMushroomNum() != 0) {
                wareHouse.setMushroomNum(wareHouse.getMushroomNum() - 1);
                jlb_num_mushroom.setText(Integer.toString(wareHouse.getMushroomNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (jcb_redonion.isSelected()) {
            if (wareHouse.getRedOnionNum() != 0) {
                wareHouse.setRedOnionNum(wareHouse.getRedOnionNum() - 1);
                jlb_num_redonion.setText(Integer.toString(wareHouse.getRedOnionNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }
        if (jcb_seafood.isSelected()) {
            if (wareHouse.getSeafoodNum() != 0) {
                wareHouse.setSeafoodNum(wareHouse.getSeafoodNum() - 1);
                jlb_num_seafood.setText(Integer.toString(wareHouse.getSeafoodNum()));
            } else {
                showMsg("Sold Out!");
                return;
            }
        }

//        jlb_num_cheese.setText(Integer.toString(wareHouse.getCheeseNum()));
//        jlb_num_beef.setText(Integer.toString(wareHouse.getBeefNum()));
//        jlb_num_mushroom.setText(Integer.toString(wareHouse.getMushroomNum()));
//        jlb_num_redonion.setText(Integer.toString(wareHouse.getMushroomNum()));
//        jlb_num_seafood.setText(Integer.toString(wareHouse.getSeafoodNum()));
    }//GEN-LAST:event_jButton3ActionPerformed

    //get change
    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        if( jlbl_moneyReceive.getText() == "" || moneyReceive< payment.calculatePayment()){
            showMsg("You haven't payed!");
            return;
        }
        Change change = new Change(this.moneyTypeList);
        HashMap<String, Integer> hm = change.changing(moneyReceive - payment.calculatePayment());
        String chingString = "";
        for (String key : hm.keySet()) {
            chingString += key + " * " + hm.get(key) + "<br>";
        }
        jbl_change.setText("<html>" + chingString + "</html>");
        jlb_change.setText(format(moneyReceive - payment.calculatePayment()));

        try {
            vm.pay();
        } catch (Exception e) {
        }
        jlb_machine_state.setText(vm.DisplayState());
//        showMsg(vm.DisplayState());

    }//GEN-LAST:event_jButton10ActionPerformed

    class inner implements Runnable {

        public void run() {

            try {

                Thread.sleep(3000);
                vm.cooking();
                jlb_machine_state.setText(vm.DisplayState() + "...");

                Thread.sleep(3000);
                vm.finishCooking();
                jlb_machine_state.setText(vm.DisplayState());

            } catch (Exception e) {
            }

        }
    }

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        try {
            vm.makingChange();
            jlb_machine_state.setText(vm.DisplayState());

            Thread t = new Thread(new inner());
            t.start();

//            showMsg(vm.DisplayState());



//            showMsg(vm.DisplayState());


        } catch (Exception e) {
        }







    }//GEN-LAST:event_jButton13ActionPerformed

    private void jtf_adminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_adminActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_adminActionPerformed

    //login
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        String adminString = jtf_admin.getText();
        String pwdString = new String(jpf_pwd.getPassword());
        Adminstrator adminstrator = new Adminstrator();
        if (adminstrator.login(adminString, pwdString)) {
            jpl_setting.setVisible(true);
            jtf_beef.setText(Integer.toString(wareHouse.getBeefNum()));
            jtf_cheese.setText(Integer.toString(wareHouse.getCheeseNum()));
            jtf_cheese_base.setText(Integer.toString(wareHouse.getCheeseBaseNum()));
            jtf_classic.setText(Integer.toString(wareHouse.getClassicBaseNum()));
            jtf_crispy.setText(Integer.toString(wareHouse.getCrispyBaseNum()));
            jtf_mushroom.setText(Integer.toString(wareHouse.getMushroomNum()));
            jtf_pepperoni.setText(Integer.toString(wareHouse.getPepperoniBaseNum()));
            jtf_redonion.setText(Integer.toString(wareHouse.getRedOnionNum()));
            jtf_seafood.setText(Integer.toString(wareHouse.getSeafoodNum()));
            jtf_veggie.setText(Integer.toString(wareHouse.getViggieBaseNum()));
        } else {
            showMsg("Login Error");
        }

    }//GEN-LAST:event_jButton1ActionPerformed

    private void jtn_saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtn_saveActionPerformed
        wareHouse.setBeefNum(Integer.parseInt(jtf_beef.getText()));
        wareHouse.setCheeseNum(Integer.parseInt(jtf_cheese.getText()));
        wareHouse.setCheeseBaseNum(Integer.parseInt(jtf_cheese_base.getText()));
        wareHouse.setClassicBaseNum(Integer.parseInt(jtf_classic.getText()));
        wareHouse.setCrispyBaseNum(Integer.parseInt(jtf_crispy.getText()));
        wareHouse.setMushroomNum(Integer.parseInt(jtf_mushroom.getText()));
        wareHouse.setPepperoniBaseNum(Integer.parseInt(jtf_pepperoni.getText()));
        wareHouse.setRedOnionNum(Integer.parseInt(jtf_redonion.getText()));
        wareHouse.setSeafoodNum(Integer.parseInt(jtf_seafood.getText()));
        wareHouse.setViggieBaseNum(Integer.parseInt(jtf_veggie.getText()));
        
    }//GEN-LAST:event_jtn_saveActionPerformed

    private void jcb_cheeseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcb_cheeseActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcb_cheeseActionPerformed

    /**
     * showing a message
     *
     * @param msg
     */
    public void showMsg(String msg) {
        JOptionPane messageJOptionPane = new JOptionPane();
        messageJOptionPane.showMessageDialog(this,
                msg,
                "A plain message",
                JOptionPane.PLAIN_MESSAGE);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                Toolkit tk = Toolkit.getDefaultToolkit();
                int xSize = ((int) tk.getScreenSize().getWidth());
                int ySize = ((int) tk.getScreenSize().getHeight());



                javax.swing.JFrame mainFrame = new main();
                mainFrame.setSize(xSize, ySize);
                mainFrame.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Canvas canvas1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton3;
    private javax.swing.JFrame jFrame1;
    private javax.swing.JFrame jFrame2;
    private javax.swing.JFrame jFrame3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel jbl_change;
    private javax.swing.JButton jbt_money1;
    private javax.swing.JButton jbt_money2;
    private javax.swing.JButton jbt_money3;
    private javax.swing.JButton jbt_money4;
    private javax.swing.JButton jbt_money5;
    private javax.swing.JButton jbt_money6;
    private javax.swing.JButton jbt_money7;
    private javax.swing.JButton jbt_money8;
    private javax.swing.JButton jbt_money9;
    private javax.swing.JButton jbtn_caculate;
    private javax.swing.JButton jbtn_next_1;
    private javax.swing.JComboBox jcb_base;
    private javax.swing.JCheckBox jcb_beef;
    private javax.swing.JCheckBox jcb_cheese;
    private javax.swing.JComboBox jcb_country;
    private javax.swing.JCheckBox jcb_mushroom;
    private javax.swing.JCheckBox jcb_redonion;
    private javax.swing.JCheckBox jcb_seafood;
    private javax.swing.JLabel jlabel_discount;
    private javax.swing.JLabel jlabel_gst;
    private javax.swing.JLabel jlabel_price;
    private javax.swing.JLabel jlabel_total;
    private javax.swing.JLabel jlb_change;
    private javax.swing.JLabel jlb_machine_state;
    private javax.swing.JLabel jlb_num_base;
    private javax.swing.JLabel jlb_num_beef;
    private javax.swing.JLabel jlb_num_cheese;
    private javax.swing.JLabel jlb_num_mushroom;
    private javax.swing.JLabel jlb_num_redonion;
    private javax.swing.JLabel jlb_num_seafood;
    private javax.swing.JLabel jlbl_moneyReceive;
    private javax.swing.JPasswordField jpf_pwd;
    private javax.swing.JPanel jpl_money;
    private javax.swing.JPanel jpl_setting;
    private javax.swing.JPanel jpnl_Pizza;
    private javax.swing.JPanel jpnl_country;
    private javax.swing.JTextField jtf_admin;
    private javax.swing.JTextField jtf_beef;
    private javax.swing.JTextField jtf_cheese;
    private javax.swing.JTextField jtf_cheese_base;
    private javax.swing.JTextField jtf_classic;
    private javax.swing.JTextField jtf_crispy;
    private javax.swing.JTextField jtf_mushroom;
    private javax.swing.JTextField jtf_pepperoni;
    private javax.swing.JTextField jtf_redonion;
    private javax.swing.JTextField jtf_seafood;
    private javax.swing.JTextField jtf_veggie;
    private javax.swing.JButton jtn_save;
    // End of variables declaration//GEN-END:variables
}
